#ifndef __DEF_ITEMSDIALOG_H__
#define __DEF_ITEMSDIALOG_H__

#include <wx/wx.h>
#include <wx/bmpcbox.h>
#include "appconstant.h"
#include "dbkakeibo.h"
#include <vector>

class ItemsDialog: public wxDialog
{
public:
	ItemsDialog(wxWindow *parent);
	~ItemsDialog(void)
	{
		dbitems = 0;
	}
	
	void BindData_Items(int expense, std::vector<DB_items> *dbs, int maxcnt);
	void BindData_Icon(void);
	std::vector<DB_items> GetChangedData(modifyType mt = none_mt);
	void ClearControl(void) {
		id_InputItemsName->Clear();
	}
	int GetUpdatedItemsId(void);
protected:
	wxListBox *id_ItemsList;
	wxButton *id_AddItems;
	wxButton *id_ModItems;
	wxButton *id_DelItems;
	wxStaticBox *id_ItemsInfo;
		wxTextCtrl *id_InputItemsName;
		wxBitmapComboBox *id_ItemsImage;
	
	wxButton *id_OkBtn;
	wxButton *id_CanBtn;

	void id_AddItems_clicked(wxCommandEvent &event);
	void id_ModItems_clicked(wxCommandEvent &event);
	void id_DelItems_clicked(wxCommandEvent &event);
	void id_ItemsList_selected(wxCommandEvent &event);

	void id_OkBtn_clicked(wxCommandEvent &event);
	void id_CanBtn_clicked(wxCommandEvent &event);

private:
	DECLARE_EVENT_TABLE()

	std::vector<DB_items> *dbitems;
	std::vector<int> dbitemsId;
	int expenseId;
	int maxitemsId;
};

enum {
	items_ok = 150,
	items_can,
	items_add,
	items_mod,
	items_del,
	items_list

};

#endif